Repository navigation
Conversation
A concurrent `stop`, `stop --all`, or rollback could prune a project's Docker network between `start` creating it and attaching the first container, failing `start` with "network ... not found". `start`, `db start` (including declarative auto-start), and `stop` now hold a cross-process lifecycle lock under `$SUPABASE_HOME/locks`: a per-project lock keyed by the project's Docker label, behind a shared gate that `stop --all` takes exclusively. A blocked command prints one waiting line and gives up after 10 minutes.
There was a problem hiding this comment.
🤖 AI Review
Verified all three Claude findings and confirmed them as nits: one misleading waiting message and two documentation gaps. Codex reported no findings. No functional defect was established. Tests were not run; dependencies are absent from the checkout.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| ⚪ NIT | apps/cli/src/command-internal/project-lifecycle-lock.ts:131 |
ux |
claude | When stop --all blocks the shared gate, the waiting message describes project-specific contention, while the eventual timeout correctly identifies an all-projects stop. |
| ⚪ NIT | apps/cli/src/commands/start/SIDE_EFFECTS.md:231 |
documentation |
claude | The start, db start, and stop exit-code tables document ProjectLifecycleLockBusyError but omit the new ProjectLifecycleLockIoError failure. |
| ⚪ NIT | packages/stack/src/effect.ts:92 |
documentation |
claude | The isLockBusy documentation mentions only holdLock even though the helper also classifies failures from holdSharedLock and holdExclusiveLock. |
Stats
Claude findings: 3 · Codex findings: 0 · Confirmed: 3 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
Coly010
left a comment
There was a problem hiding this comment.
approving so you're not blocked, one question though:
with an unwritable $SUPABASE_HOME, start and stop now fail before touching Docker (failed to create …/locks: PermissionDenied), where develop starts and stops fine. stop is the one i'd worry about most, since there's no way to tear the stack down from that environment at all
the start lock from #7369 carries on unlocked in that case (with a debug line) - any reason not to do the same here, at least for stop? totally fine to push back if you think a read-only home isn't worth supporting
# Conflicts: # apps/cli/src/command-internal/db-bootstrap/start-local-database.ts # apps/cli/src/commands/db/start/SIDE_EFFECTS.md # apps/cli/src/commands/start/SIDE_EFFECTS.md
|
Good catch, agreed. In d99df44 the lifecycle lock now behaves like the start lock from #7369: if |
CLI benchmark: no changes foundCommit
API calls: unchanged for all 7 commands. Binary size: 133.8 MB, unchanged. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
Addresses #7339
Problem
Between
startcreating a project's Docker network and attaching its first container, the network has no endpoints. Any project-label-filtereddocker network prunethat lands in that window removes it, andstartthen fails withnetwork supabase_network_<id> not found. Within one invocation every prune runs before bring-up (stopped-stack recovery) or after it stops (rollback), so the prune in the report most likely came from an overlapping lifecycle command on the same project: an earlierstartstill rolling back, astop,stop --all, or adb startrollback.Change
start,db start(including the declarative auto-start), andstophold a cross-process lifecycle lock under$SUPABASE_HOME/locks:project_idserialize and different projects still run in parallel;stop --allholds exclusively.@supabase/stackgainsholdSharedLock/holdExclusiveLocknext toholdLock.ensureNetworkdoc comment no longer claims the network cannot be removed mid-run.Limitations
Older CLI binaries, raw
dockercommands, a differentSUPABASE_HOME, and projects sharing a custom--network-iddo not participate, andstop --allis not queued ahead of a stream of single-project commands (documented instart'sSIDE_EFFECTS.md).db resetand the shadow database still create their network without the lock; that is a separate follow-up. When$SUPABASE_HOME/lockscannot be created or a lock file there cannot be opened, these commands continue without the lock and log a debug line.